#include "SpriteManager.h"

SpriteManager::SpriteManager() {
    orderCounter = 0;
}

SpriteManager::~SpriteManager() { 
}


void SpriteManager::Draw(Sprite &sprite) {
    // add sprite (and increment order counter)
    sprites.push(SpriteContainer(sprite,orderCounter++));
}

void SpriteManager::Render(RenderWindow &app) {
    // render the sprites in order
    while (!sprites.empty()) {
        app.Draw(sprites.top().sprite);
        sprites.pop();
    }
    // reset order counter
    orderCounter = 0;
}
